import request from '@/config/axios'
import type { SmsLog } from './types'
import { Reservation } from '../reservation/types'

export const getSmsLogsListApi = (params: any): Promise<IResponse<IResData<SmsLog>>> => {
  return request.get({ url: '/sms-logs', params })
}

export const createSmsLogsApi = (data: Partial<SmsLog>): Promise<IResponse> => {
  return request.post({ url: '/sms-logs', data })
}

export const bulkCreateSmsLogsApi = (data: Reservation[]): Promise<IResponse<SmsLog[]>> => {
  return request.post({ url: '/sms-logs/bulk/create', data })
}

export const getSmsLogsListBySequenceApi = (sequence: string): Promise<IResponse<SmsLog[]>> => {
  return request.get({ url: `/sms-logs/sequence/${sequence}` })
}

export const updateSmsLogsApi = (id: string, data: Partial<SmsLog>): Promise<IResponse> => {
  return request.put({ url: `/sms-logs/id/${id}`, data })
}

export const getSmsLogsDetailApi = (id: string): Promise<IResponse<SmsLog>> => {
  return request.get({ url: `/sms-logs/id/${id}` })
}

export const delSmsLogsListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/sms-logs/id/${ids[0]}` })
}
